
import java.io.*;
public class Read implements Runnable {
    DataInputStream in;
    ObjectInputStream objIn;
    Person p;
    public void setDataInputStream(DataInputStream in) throws IOException {
        this.in = in;
    }
    public void  setObjectInputStream(ObjectInputStream objIn){
        this.objIn=objIn;
    }
    public void run() {
        double result=0;
        while(true) {
            try{
                /*result=in.readDouble();
                System.out.println("圆的面积:"+result);
                System.out.print("输入园的半径(放弃请输入N):");
                *、
                 */
                try {
                    p= (Person) objIn.readObject();
                    System.out.println("从服务器端接收到得人员信息为："+p);
                } catch (ClassNotFoundException e) {
                    e.printStackTrace();
                }
            }
            catch(IOException e) {
                System.out.println("与服务器已断开"+e);
                break;
            }
        }
    }
}